package city.spring.action.model;

/**
 * 投诉的受理员工信息
 */
public abstract class AbstractComplaintReceiver<RECEIVER> {

    /**
     * 该人的唯一Key
     *
     * @return 唯一键值
     */
    public abstract Object getKey();

    /**
     * 该人的姓名
     *
     * @return 姓名
     */
    public abstract String getName();


    /**
     * 部门
     *
     * @return
     */
    public abstract String getOrgName();

    /**
     * 职务
     *
     * @return
     */
    public abstract String getJob();

    /**
     * 手机号码
     *
     * @return
     */
    public abstract String getTelPhone();

    /**
     * 获取原始对象
     *
     * @return 原始对象
     */
    public abstract RECEIVER getObject();


    @Override
    public boolean equals(Object object) {
        if (object instanceof AbstractComplaintReceiver) {
            AbstractComplaintReceiver<?> complaintReceiver = (AbstractComplaintReceiver<?>) object;
            Object key1 = this.getKey();
            Object key2 = complaintReceiver.getKey();
            return key1 != null && key1.equals(key2);
        }
        return false;
    }
}
